home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Java Programmer's Toolkit
/
Java Programmer's Toolkit.iso
/
applets
/
whatsnew
/
whatsn~2.jav
< prev
Wrap
Text File
|
1995-10-10
|
757b
|
42 lines
import java.awt.*;
/**
* @author Arthur van Hoff
*/
public class WhatsNew extends java.applet.Applet implements Runnable {
Image imgs[];
int current;
Thread blinker;
public void init() {
imgs = new Image[2];
imgs[0] = getImage(getCodeBase(), "whatsnew1.gif");
imgs[1] = getImage(getCodeBase(), "whatsnew2.gif");
}
public void start() {
blinker = new Thread(this);
blinker.start();
}
public void stop() {
blinker.stop();
}
public void run() {
try {
while (true) {
repaint();
current = 0;
Thread.sleep(1000);
current = 1;
repaint();
Thread.sleep(500);
}
} catch (InterruptedException e) {
}
}
public void paint(Graphics g) {
g.drawImage(imgs[current], 0, 0, this);
}
}